package Object;
import utils.*;

public class Clone2 {
	static public void main(String[] args){
		CloneObject1 c1 = new CloneObject1("c1");
		CloneObject1 c2 = (CloneObject1)c1.clone();
		Utils.println(c1.name);
		Utils.println(c2.name);
		
		c1.name = "change c1 name";
		Utils.println(c1.name);
		Utils.println(c2.name);
	}
}

class CloneObject1 implements Cloneable{
	String name;
	CloneObject1(String name){
		this.name = name;
	}
	
	public Object clone(){
		try {
			return super.clone();
		} catch (CloneNotSupportedException e) {
			// TODO: handle exception
			Utils.println(e.toString());
			return null;
		}
	}
}


